#coding:utf-8


from nn.Network import *
import nn.mnist_loader as mnist_loader
import numpy as  np
from functools import reduce

def func001():
    n = [i for i in range(1, 100)]
    print(n[1:10])
    ll = len(n)
    size = 5
    batch = [n[k:k + size] for k in range(0, ll, size)]
    print(batch)


def func002():
    net=Network([784, 100, 10])
    print(net.bias[-1].shape)
    print(net.bias)
    print(net.weights[0].shape)
    print(net.weights[1].shape)


def lambda001():
    b = np.array([0, 1, 2, 3, 1, 1])
    print(type(b))
    a=[1,0,0,0,0,0]
    if not isinstance(a,np.ndarray):
        a=np.array(a)

    z=sum(map(lambda x:x*x,a-b))
    print(z)

if __name__=='__main__':
    #lambda001()

    training_data, validation_data, test_data =mnist_loader.load_data_wrapper()
    net = Network([784, 30, 10])
    net.SGD(training_data, 30, 10,3.0, test_data=test_data)